#include <bits/stdc++.h>

using namespace std;

int n;
int a[100005];

int main() {
	freopen("duel.in", "r", stdin);
	freopen("duel.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	int res = 0;
	for (int l = 1, r = 1; l <= n; l = r) {
		while (r <= n && a[l] == a[r])
			r++;
		res -= min(res, r - l);
		res += r - l;
	}
	cout << res << '\n';
	return 0;
}
